<template>
  <quill-editor
    v-model="model"
    :placeholder="placeholder? placeholder: $t('message.qsrnr') + '...'"
    class="myQuillEditor"
    :options="quillOption"
    @input="handleInput"
  />
</template>
<script>
// 引入包
import { quillEditor } from 'vue-quill-editor'
import quillConfig from '@/api/sc.js'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
export default {
  components: {
    quillEditor
  },
  props: {
    value: {
      type: String,
      default: ''
    },
    placeholder: {
      type: String,
      default: ''
    },
    disabled: Boolean
  },
  data() {
    return {
      model: '',
      quillOption: quillConfig
    }
  },
  watch: {
    value(newValue, oldValue) {
      this.model = newValue
    }
  },
  mounted() {},
  created() {

  },
  methods: {
    handleInput(value) {
      // 将文本内容传给父组件（引用这个组件的vue文件的）
      this.$emit('input', value)
    }
  }
}
</script>
<style lang="scss" scoped>
.disable-layer {
  width: 100%;
  height: 100%;
  background: #f5f7fa;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  opacity: 0.5;
}
</style>
